﻿using BCCServer.IService.IUserService;
using BCCServer.Model.ModelsOut;
using Microsoft.AspNetCore.Mvc;

namespace BCCServer.Web.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class UserController : ControllerBase
    {
        private readonly IUser iuser;

        public UserController(IUser iuserDB)
        {
            this.iuser = iuserDB;
        }

        [HttpGet]
        [Route("selUserInfo")]
        /// <summary>
        /// 根据账号查询用户信息
        /// </summary>
        /// <param name="sendAccount"></param>
        /// <param name="receiveAccount"></param>
        /// <returns></returns>
        public BaseOut selUserInfo(string Account)
        {
            try
            {
                var rs = iuser.selUserInfo(Account);
                return new BaseOut {code="true",content= rs };
            }
            catch (Exception)
            {
                return new BaseOut { code = "false", content = "查询失败" };
            }
        }
    }
}
